const CompressionWebpackPlugin = require('compression-webpack-plugin');
const productionGzipExtensions = ['js', 'css'];
module.exports = {
	publicPath: "./",
	productionSourceMap: false,
	configureWebpack: {
		plugins: [
			new CompressionWebpackPlugin({
				filename: '[path].gzip[query]', // 提示compression-webpack-plugin@2.0.0的话filename改为asset
				algorithm: 'gzip',
				test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
				threshold: 10240, //内容超过10KB进行压缩
				minRatio: 0.8
			})
		],
	},
	devServer: {
		proxy: {
			'/wsj': {
				target:'https://test.kuaibuapp.com',
				changeOrigin: true,
				pathRewrite: {
					'^/wsj': ''
				}
			},
		},

	},

}
